cmake_minimum_required(VERSION 2.8.3)
project(map_server_db)
if(UNIX)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
endif(UNIX)
## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages

find_package(catkin REQUIRED COMPONENTS
  roscpp
  rospy
  std_msgs
 navigation_msg
  message_generation
)


catkin_package(

  #INCLUDE_DIRS include
  LIBRARIES navigation/small_car_map
  CATKIN_DEPENDS message_runtime roscpp rospy std_msgs navigation_msg
  DEPENDS system_lib
  
)

###########
## Build ##
###########

## Specify additional locations of header files
## Your package locations should be listed before other locations
# include_directories(include)
include_directories(include ${catkin_INCLUDE_DIRS} )

# Library definitions

add_library(odom_slam src/odom_slam.cpp )
add_library(odom_imu src/odom_imu.cpp )
add_library(odom_gps src/odom_gps.cpp )
add_library(smallcardb src/smallcardb.cpp )
add_library(small_car_map src/small_car_map.cpp )




#add_library(motion src/motion.cpp )

#设置要寻找的链接库的名字，这里应该是找libmysqlclient.so
SET(MYSQL_NAMES mysqlclient mysqlclient_r)
#将libmysqlclient.so的路径放到MYSQL_LIBRARY
FIND_LIBRARY(MYSQL_LIBRARY
  NAMES ${MYSQL_NAMES}
  PATHS /usr/lib /usr/lib/x86_64-linux-gnu/
  PATH_SUFFIXES mysql
)

# Dependencies


# Executables
#add_executable(small_car src/gpio_init.cpp src/jetsonGPIO.c src/small_car.cpp）

add_executable(small_car_map_node src/small_car_map_node  src/small_car_map.cpp  src/smallcardb.cpp  src/odom_gps.cpp src/odom_imu.cpp src/odom_slam.cpp)

# Linking

target_link_libraries(small_car_map_node ${catkin_LIBRARIES} ${MYSQL_LIBRARY} )



